﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using CCWin;
namespace weiqijiance.工位配置
{
    public partial class SLsetting : CCSkinMain
    {
        public SLsetting()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            iniclass objini = new iniclass();
            string path = "";
            path = System.Windows.Forms.Application.StartupPath + path + "\\安综检仪表配置.ini";
            string path1 = string.Format(@"{0}", path);
            objini.Ini(path1);
            objini.Writue("侧滑", "检测线结束设备", checkBox2.Checked ? "1" : "0");
            objini.Writue("侧滑", "信息显示时间", textBox3.Text);
            objini.Writue("侧滑", "只检单独综检", che_ddzj.Checked ? "是" : "否");
            objini.Writue("侧滑", "双转向轴免检", che_szxzmj.Checked ? "是" : "否");
            MessageBox.Show("完成");
            基类窗体.UploadAndDownload fupload = new 基类窗体.UploadAndDownload();
            objini.Ini(System.Windows.Forms.Application.StartupPath + "\\系统信息.ini");
            string sjcxname = objini.ReadValue("系统信息", "检测线名称");
            string sgongweiname = objini.ReadValue("系统信息", "检测工位名称");
            fupload.upload(sjcxname, sgongweiname, "安综检仪表配置.ini");
        }

        private void SLsetting_Load(object sender, EventArgs e)
        {
            iniclass objini = new iniclass();
            string path = "";
            path = System.Windows.Forms.Application.StartupPath + path + "\\安综检仪表配置.ini";
            string path1 = string.Format(@"{0}", path);
            objini.Ini(path1);
            checkBox2.Checked = (objini.ReadValue("侧滑", "检测线结束设备").Trim() == "1") ? true : false;
            textBox3.Text = objini.ReadValue("侧滑", "信息显示时间").Trim();
            che_ddzj.Checked = objini.ReadValue("侧滑", "只检单独综检").Trim().Contains("是") ? true : false;
            che_szxzmj.Checked = objini.ReadValue("侧滑", "双转向轴免检").Trim().Contains("是") ? true : false;
        }
    }
}
